import React from 'react';
import styles from './index.less';
import { history, formatMessage, useIntl, getDvaApp, withRouter, connectMaster } from 'umi';
import { Button } from 'antd';
import { connect } from 'dva';
import { routerGo } from '@/utils/router';

@connect(({ user }) => ({
  user
}))
export default class extends React.Component {
  componentDidMount() {

  }
  render() {
    const { user } = this.props
    console.log(user)
    return (
      <div>
        <div style={{ marginBottom: '30px' }}>
          我是main  给 app1 加的2一些内容  userId: {user.user.userId}
          <Button
            type="primary"
            onClick={() => {
              this.props.dispatch({
                type: 'user/setState', payload: {
                  user: { userId: "被main修改了" }
                }
              })
            }}
          >修改</Button>
        </div>
      </div>
    );
  }
}








